package com.wzt.gift.fallback;

import com.wzt.gift.client.SmsVerifyCodeSendClient;
import com.wzt.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author Zenith
 * @Date 2022/10/12 19:11
 * @Version 1.0
 */
@Component
public class SmsVcSendFallbackFactory implements FallbackFactory<SmsVerifyCodeSendClient> {

    @Override
    public SmsVerifyCodeSendClient create(Throwable throwable) {
        return new SmsVerifyCodeSendClient() {
            @Override
            public String sendVerifyCode(String phone) {
                throwable.printStackTrace();
                return new String("发送验证码失败！");
            }
        };
    }
}
